// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.audio.parameters;

import zombie.audio.FMODLocalParameter;
import zombie.scripting.objects.VehicleScript;
import zombie.vehicles.BaseVehicle;
import zombie.vehicles.VehiclePart;

public class ParameterVehicleTireMissing extends FMODLocalParameter {
    private final BaseVehicle vehicle;

    public ParameterVehicleTireMissing(BaseVehicle _vehicle) {
        super("VehicleTireMissing");
        this.vehicle = _vehicle;
    }

    @Override
    public float calculateCurrentValue() {
        boolean _boolean = false;
        VehicleScript vehicleScript = this.vehicle.getScript();
        if (vehicleScript != null) {
            for (int _int = 0; _int < vehicleScript.getWheelCount(); _int++) {
                VehicleScript.Wheel wheel = vehicleScript.getWheel(_int);
                VehiclePart vehiclePart = this.vehicle.getPartById("Tire" + wheel.getId());
                if (vehiclePart == null || vehiclePart.getInventoryItem() == null) {
                    _boolean = true;
                    break;
                }
            }
        }

        return _boolean ? 1.0F : 0.0F;
    }
}
